package com.codingman.thymeleafdemo1;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.WebContext;

public class demo1Servlet extends HttpServlet {
	@Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
		WebContext ctx = new WebContext(request, response, request.getServletContext());
		ctx.setVariable("message", "Hello Thymeleaf Course!");
        
		TemplateEngine engine = ThymeleafUtil.getTemplateEngine(request.getServletContext());
		engine.process("demo1", ctx, response.getWriter());
	}
}
